home *** CD-ROM | disk | FTP | other *** search
- /* Pseudo-PDQ Interface Screen for OS/2 Extended Edition. */
- /* Accepts requests for file transfer, handles CP messages, and */
- /* processes VM commands (sent as file transfer requests). */
-
- /* Larry Margolis, MARGOLI at YORKTOWN. IBM Internal Use Only. */
-
- if arg(1)='?' then do
- say 'LAMPDQ is a pseudo-PDQ interface for use with OS/2 EE before the'
- say 'ECF component is available. See LAMPDQ NEWS on PCTOOLS for details.'
- exit 100
- end
-
- cmd='Command'; set='Command set'; res=set 'reserved'; nl='15'x
- parse source . . myname ft fm .
-
- parse value qdisk('?') with . . . . . . bigdisk .
- if bigdisk='' then do; say 'You have no read/write disk space.'; exit 4; end
-
- trace -1; address 'XEDIT' set 'SCREEN 1'
- if rc=-3 then do /* XEDIT not active */
- push myname 'QUIT'
- Address '' 'XEDIT' myname ft fm '(NOPROF NOMSG'
- exit rc
- end
-
- address 'XEDIT'
- parse value diag(8,'QUERY SET') with ,
- 'MSG ' msgset ',' 'WNG ' wngset ',' ,
- 'EMSG ' emsgset ',' 'IMSG ' imsgset ',' ,
- 'VMCONIO ' vmcset ',' 'CPCONIO ' cpcset . ','
- parse value cpcset with cpcset . '15'x /* Maybe necessary for non-Ykt */
- call initialize
- call cpset
- call init_screen
- cmd 'Preserve'
- set 'BRKKEY OFF' /* Trap PA1, also. */
- address '' 'IDENTIFY (LIFO'
- if rc=0 then pull . . node .
- set 'msgmode on long'
- set 'msgline on 1' lscreen.5 'overlay'
- if left(node,3)='YKT' then do
- 'QUERY CMSLEVEL (LIFO'
- if rc = 0 then do
- pull cms .
- if CMS <> 'VM/XA' then
- set 'CPMSG OFF' /* Don't ask XEDIT to trap CP messages. */
- end
- end
-
- lastcmd=''
- call pulliucv
- Do forever
- cmdline=''
- key='?'
- address '' 'DESBUF'
- cmd 'Read Cmdline tag'
- Do queued()
- parse pull tag rest
- if tag='CMD' then cmdline=rest
- else do
- if tag='PFK' | tag='PAK' then key=tag || subword(rest,1,1)
- else key=tag
- end
- end
- call pulliucv
- if key='PFK3' | key='PFK15' then leave
- if key='PAK1' then do /* CP mode, but restore CP settings first. */
- call cprestore
- Address '' 'CP'
- call cpset
- iterate
- end
- if cmdline<>'' then do
- if cmdline='?' then do; cmd 'CMSG' lastcmd; iterate; end
- /* Uncomment the following line for a trace of commands executed. */
- /* Address '' 'EXECIO 1 DISKW LAMPDQ TRACE A (VAR CMDLINE FINIS' */
- parse var cmdline cmdname verb fn ft fm '(' opts
- if cmdname='IND$FILE' then do /* Special handling */
- if verb fn ft = 'GET HOSTCMD' then do
- ft='CMSUT1'; fm=bigdisk
- call docmd opts, fn ft
- opts='ASCII CRLF'
- end
- else if verb fn ft = 'GET MSGS' then do
- ft='CMSUT1'; fm=bigdisk
- call domsgs fn ft
- opts='ASCII CRLF'
- end
- Address '' 'IND$FILE' verb fn ft fm '(' opts
- conio=0
- call pulliucv 'CMD'
- iterate
- end
- if cmdname='LAMPDQ' then do /* Special handling; used by CP78 */
- if verb='HOSTCMD' then do
- parse var cmdline . . hostcmd
- call docmd hostcmd, 'HOSTCMD CMSUT1'
- end
- else if verb='MSGS' then call domsgs 'MSGS CMSUT1'
- iterate
- end
- call cprestore
- trace -1
- 'CMS' cmdline
- call cpset
- lastcmd=cmdline
- end
- else if key='ETK' then do /* Enter key pressed; no command entered: */
- do i=1 to msgs /* display any messages received. */
- cmd "msg" msgs.i
- end
- msgs=0
- end
- end
- Address '' "WAKEUP ( RESEXT QUIET"
- Address '' "WAKEUP RESET ( QUIET"
- call cprestore
- Do i=1 to lscreen.5-2
- res i 'OFF'
- End
- Do i=1 to msgs
- cmd "msg" msgs.i
- end
- cmd 'Restore'
- if arg(1)='QUIT' then 'QUIT'
- exit
-
- initialize: Address ''
- /**
- ** initial WAKEUP processing
- **/
- issubset = cmsflag('SUBSET')
- "NUCEXT WAKEUP"
- if rc ^= 0 then
- if issubset then "NUCXLOAD WAKEUP ( SYSTEM SERVICE"
- else "WAKEUP ( QUIET"
- "WAKEUP (NOEXT QUIET"
- "WAKEUP VERSION (QUIET"
- if rc = 201 then do /* too old for us */
- wkrc = rc
- "WAKEUP (RESEXT QUIET"
- 'SET CMSTYPE RT'
- say ' Your copy of WAKEUP MODULE is out of date and unusable'
- say ' with' myname'. Obtain WAKEUP version 5.4.1 from VMTOOLS'
- say ' (master disk at YKTVMZ).'
- if arg(1)='QUIT' then address 'XEDIT' 'QUIT'
- exit
- end
- msgs=0
- return
-
- docmd: procedure expose conio conio. msgs msgs. bigdisk
- parse arg cmd , fn ft .
- trace -1
- Address 'CMS' cmd /* Execute command */
- conio=1; conio.1=rc
- call pulliucv 'CMD'
- Address '' 'EXECIO' conio 'DISKW' fn ft bigdisk'3 1 (STEM CONIO. FINIS'
- drop conio.
- return
-
- domsgs: procedure expose msgs msgs. bigdisk
- parse arg fn ft .
- if msgs=0 then do; msgs=1; msgs.1=' '; end
- Address '' 'EXECIO' msgs 'DISKW' fn ft bigdisk'3 1 (STEM MSGS. FINIS'
- drop msgs.; msgs=0
- return
-
- init_screen:
- cmd 'extract /lscreen/'
- Do i=1 to 5
- res i 'nohigh'
- End
- res ' 6 nohigh LL AAAAAAAAAAAA MMMM MMM'
- res ' 7 nohigh LL AA AA MM MM MM MM'
- res ' 8 nohigh LL AA AA MM MM MM MM'
- res ' 9 nohigh LL AA AA MM MM MM MM'
- res '10 nohigh LL AAAAAAAAAAAAAAAA MM MMMM MM'
- res '11 nohigh LL Lawrence AA AA MM MM MM'
- res '12 nohigh LL AA Alan AA MM MM'
- res '13 nohigh LL AA AA MM Margolis MM'
- res '14 nohigh LLLLLLLLLLLLL AA AA MM MM'
- res '15 nohigh'; res '16 nohigh'
- res '17 high LaMail Interface Screen for OS/2 Extended Edition'
- res '18 nohigh'
- res '19 high IBM Internal Use Only (Rel 0.3)'
- Do i=20 to lscreen.5-3
- res i 'nohigh'
- End
- res lscreen.5-2 'high Enter VM commands below, or press F3 to terminate LaMail interface.'
- return
-
- /* *IUCV - Unknown IUCV message type
- *MSG - CP MSG or MSGNOH command
- *WNG - CP WNG command
- *EMSG - SET EMSG IUCV
- *IMSG - SET IMSG IUCV
- *SMSG - SET SMSG IUCV
- *CP - SET CPCONIO IUCV
- *VM - SET VMCONIO IUCV
- *SCIF - SET SCIF IUCV
- */
- pullIUCV: parse arg flag
- do forever
- Address '' 'WAKEUP +00:00:00 (IUCVMSG QUIET'
- If rc = 2 then
- if queued()=0 then leave
- else do; parse pull line; type='QUEUED'; end
- else Parse pull type uid line
- If type='*MSG' | type='*WNG' | type='*SMSG' | flag<>'CMD' then do
- msgs=msgs+1
- if type='*MSG' | type='*WNG' | type='*SMSG' then
- msgs.msgs='From' uid':' line
- else /* Asynchronous CP output; e.g., PUN FILE FROM...*/
- msgs.msgs=line
- end
- else do
- conio=conio+1
- conio.conio=line
- end
- end
- return
-
- cpset:
- call diag 8,'SET MSG IUCV'nl'SET WNG IUCV'nl'SET EMSG IUCV'nl ,
- 'SET IMSG IUCV'nl'SET VMCONIO IUCV'nl'SET CPCONIO IUCV',1
- return
-
- cprestore:
- call diag 8,'SET MSG' msgset nl'SET WNG' wngset nl'SET EMSG' emsgset nl ,
- 'SET IMSG' imsgset nl'SET VMCONIO' vmcset nl'SET CPCONIO' cpcset, 1
- return
-